Skip to content

Add timeout support for filtered orchestration purge - #255

Open
andystaples wants to merge 3 commits into
mainfrom
andystaples-add-purge-timeout
Open

Add timeout support for filtered orchestration purge#255
andystaples wants to merge 3 commits into
mainfrom
andystaples-add-purge-timeout

Conversation

@andystaples

Copy link
Copy Markdown
Contributor

Summary

  • add an optional imedelta timeout to sync and async filtered purge APIs
  • serialize the timeout into PurgeInstanceFilter.timeout and reject non-positive values
  • cover populated, omitted, and invalid timeout behavior

Closes #224

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2af7eb6a-76b9-4c7e-98d6-1efc7e873fc0
Copilot AI lite review requested due to automatic review settings August 10, 2026 17:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds parity with the underlying gRPC/protobuf contract by exposing a caller-specified timeout on filtered orchestration purge operations in the core Durable Task Python SDK.

Changes:

  • Added an optional timeout: timedelta | None parameter to both sync and async purge_orchestrations_by(...) APIs.
  • Validates timeout is positive and serializes it into PurgeInstanceFilter.timeout as a protobuf Duration when provided.
  • Added unit tests covering serialization, omission behavior, and non-positive timeout validation; documented the user-facing change in CHANGELOG.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
durabletask/internal/client_helpers.py Adds timeout validation and protobuf Duration serialization in build_purge_by_filter_req.
durabletask/client.py Plumbs the optional timeout through both sync/async purge_orchestrations_by methods and logs it.
tests/durabletask/test_purge_timeout.py Adds unit coverage for populated/omitted/invalid timeout scenarios for filtered purge APIs.
CHANGELOG.md Documents the new optional timeout capability under ## Unreleased.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@berndverst Bernd Verst (berndverst) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation correctly validates and serializes the server-side purge budget for sync and async clients, with no transport deadline or hot-path cost added. I found two non-blocking contract and release-note gaps inline.

Comment thread tests/durabletask/test_purge_timeout.py
Comment thread CHANGELOG.md
andystaples and others added 2 commits August 13, 2026 10:43
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2af7eb6a-76b9-4c7e-98d6-1efc7e873fc0

@berndverst Bernd Verst (berndverst) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second-pass review complete at 6a4e68a. The timeout is validated and encoded as the server-side purge budget for both sync and async clients without changing the gRPC deadline; completion presence is preserved as True/False/None; inherited Azure Managed and Azure Functions APIs are documented; and targeted regression, lint, strict type, wire-presence, provider-signature, and CI checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add timeout support for filtered orchestration purge

3 participants